using UnityEngine;

public class langhua : MonoBehaviour
{
	private Material material;

	public float speed = 0.05f;

	private bool isup = true;

	public float maxoffset = 0.1f;

	private void Start()
	{
		material = base.gameObject.GetComponent<Renderer>().sharedMaterial;
	}

	private void Update()
	{
		if (isup)
		{
			Vector2 mainTextureOffset = material.mainTextureOffset;
			if (mainTextureOffset.y > -2f * maxoffset)
			{
				material.mainTextureOffset += new Vector2(0f, Time.deltaTime * (0f - speed));
			}
			else
			{
				isup = false;
			}
		}
		else
		{
			Vector2 mainTextureOffset2 = material.mainTextureOffset;
			if (mainTextureOffset2.y < 0f)
			{
				material.mainTextureOffset += new Vector2(0f, Time.deltaTime * speed * 0.5f);
			}
			else
			{
				isup = true;
			}
		}
	}
}
